<?php global $base_url; ?>
<?php if (!empty($item)): ?>
<div class="cart-item">
    <div class="cart-left item-img">
        <?php $img_uri = !empty($item->field_images[LANGUAGE_NONE][0]['uri'])
            ? $item->field_images[LANGUAGE_NONE][0]['uri'] : '';?>
        <?php print theme('image_style', array('path' => $img_uri, 'style_name' => 'crop_65x65'));?>
        <?php print l(t('Remove'), 'cart/item/' . $item->nid . '/remove', array('attributes' => array('class' => array('btn', 'btn-danger'))));?>
    </div>
    <div class="cart-right">
        <div class="cart-info">
            <div class="item-name"><h3><?php print l($item->title, 'node/'.$item->nid);?></h3></div>
            <div class="item-price">
                <label>Price: </label><span><?php print '$' . $item->field_item_price[LANGUAGE_NONE][0]['value'] . ' x ' . $item->field_quantity[LANGUAGE_NONE][0]['value'];?></span>
            </div>
        </div>
        <div class="cart-options">
            <?php $options_id = !empty($item->field_item_options[LANGUAGE_NONE])
                ? $item->field_item_options[LANGUAGE_NONE] : array();?>
            <?php $tids = array();?>
            <?php foreach ($options_id as $option): ?>
            <?php $tids[] = $option['tid']; ?>
            <?php endforeach;?>
            <?php $terms = taxonomy_term_load_multiple($tids);?>
            <?php foreach ($terms as $term): ?>
            <div class="options-item">
                <input type="checkbox" id="service_<?php print $item->nid . '_' . $term->tid;?>" value="1"
                       name="service[<?php print $item->nid;?>][<?php print $term->tid;?>]" <?php print !empty($_POST['service'][$item->nid][$term->tid])
                        ? 'checked="checked"' : '';?>/>
                <label for="service_<?php print $item->nid . '_' . $term->tid;?>">
                    <?php print $term->name;?>
                    <?php if (!empty($term->field_service_price[LANGUAGE_NONE][0]['value'])): ?>
                    <?php print ' - $' . $term->field_service_price[LANGUAGE_NONE][0]['value']; ?>
                    <?php else: ?>
                    <?php print ' - Free' ?>
                    <?php endif;?>
                    <?php if ($item->field_quantity[LANGUAGE_NONE][0]['value'] > 1): ?>
                    <?php print ' x ' . $item->field_quantity[LANGUAGE_NONE][0]['value'] . ' = ' . ($term->field_service_price[LANGUAGE_NONE][0]['value'] * $item->field_quantity[LANGUAGE_NONE][0]['value']); ?>
                    <?php endif;?>
                </label>
            </div>
            <?php endforeach;?>
        </div>
    </div>
    <div class="clear"></div>
</div>
<?php endif; ?>